"""
1.导入pymysql
2.创建连接对象
3.创建游标对象
4.执行sql语句
5.获取结果集
6.关闭游标
7.关闭连接对象
"""
import pymysql

conn = pymysql.connect(host='localhost', user='root', password='root', database='advanced', charset='utf8')

cursor = conn.cursor(pymysql.cursors.Cursor)

rows = cursor.execute('select * from student')
print(rows)

all1 = cursor.fetchall()
print(all1)

cursor.close()
conn.close()
